<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\controller;

use cmf\controller\HomeBaseController;
use app\portal\model\PortalCategoryModel;
class IndexController extends HomeBaseController
{
    public function index()
    {
        $portalCategoryModel = new PortalCategoryModel();
        $categorys = $portalCategoryModel->field('id,name')->where('status', 1)->select();
        $arrCategory = array();
        foreach($categorys as $cat) {
            $arrCategory[$cat['id']] = $cat['name'];
        }
        
        $this->assign('arrCategory', $arrCategory);
        $this->assign('category', null);
        return $this->fetch('/index');
    }
}
